<?php

namespace app\common\model;

use think\Model;

class SettingTime extends Model
{
    // 表名
    protected $name = 'setting_time';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    
    // 追加属性
    protected $append = [
		'type_text'
    ];
    
    //支付超时数据ID
	const PAY_ORDER_TIME = 1;
	//签收超时数据ID
	const SIGN_ORDER_TIME = 2;
	//商家处理售后时间
	const SELLER_OPERATE_TIME = 3;

	public static $typeList = [
		self::PAY_ORDER_TIME => '付款超时时间',
		self::SIGN_ORDER_TIME => '订单签收超时',
		self::SELLER_OPERATE_TIME => '商家处理售后时间'
	];


	public function getTypeTextAttr($value, $data) {
		$value = $value?$value:$data['type'];
		$list = self::$typeList;
		return isset($list[$value])?$list[$value]:'';
	}


}
